#include "LayerBase.h"


CLayerBase::CLayerBase(void) :
	m_Director(cocos2d::Director::getInstance()),
	m_LayerManager(CLayerManager::GetInstance()),
	m_SceneManager(CSceneManager::GetInstance()),
	m_LogicData(CLogicData::GetInstance()),
	m_UiConfig(CUiConfig::GetInstance()),
	m_UiManager(CCommonUiManager::GetInstance()),

	m_Visible(nullptr)
{
	m_DataChangeStatus.resize(CLogicData::CSTotalCount, 0);
}


CLayerBase::~CLayerBase(void)
{
}

void CLayerBase::SetVisible(bool v) {
	setVisible(v);
}

bool CLayerBase::DataChanged(CLogicData::ChangeStatus status) {
	uint32_t& tCur = m_DataChangeStatus[status];
	uint32_t tStatus = m_LogicData->GetChangeStatus(status);
	if (tCur != tStatus) {
		tCur = tStatus;
		return true;
	}
	return false;
}
